<template>
<div class="left-pages">
  <div class="left-page-list">
    <el-collapse v-model="activeNames" accordion>
      <el-collapse-item name="collapse-1">
        <template #title>
          页面<i class="jy-icon-plus right" @click.stop="onAddPage($event, 1)"></i>
        </template>
        <collapse-page :type="1"></collapse-page>
      </el-collapse-item>
      <el-collapse-item name="collapse-2">
        <template #title>
          弹层<i class="jy-icon-plus right" @click.stop="onAddPage($event, 2)"></i>
        </template>
        <collapse-page :type="2"></collapse-page>
      </el-collapse-item>
    </el-collapse>
  </div>
  <!-- <i v-if="siteAttrs.h5Type == H5_TYPE.canvas" class="jy-icon-preview1 open-shut-left" @click="onOpenShut"></i> -->
</div>
</template>

<script setup lang="ts">
import CollapsePage from '@/views/child/collapse-page.vue'
import { useWebSiteStore } from "@/store/web/site"

const useWebSite = useWebSiteStore()
const activeNames = ['collapse-1']


const siteAttrs = computed(() => {
  return useWebSite.attrs
})
const onAddPage = (e: any, type: number) => {
  e.stopPropagation()
  e.preventDefault()
  //是页面还是弹出层1 页面 2 弹出层
  useWebSite.addPage(type)
}
</script>

